ci: automate version bumps via changesets (Version-PR + auto-merge)#197
Merged
Conversation
…erge) On push to main, opens a "Version Packages" PR that runs version-packages and auto-merges it, so merged changesets become an installable version bump without a manual step. No npm publish (marketplace reads the repo manifest). Also tightens the auto-merge step: PR_NUMBER is passed through an env var rather than interpolated directly into the shell command, eliminating any theoretical injection surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.github/workflows/release.yml— thechangesets/actionVersion-PR pattern with auto-merge.Flow
require-changesetCI gate).main, this workflow opens/updates a "Version Packages" PR that runsnpm run version-packages(accumulating all pending changesets).main→ the new version is installable from the marketplace.No npm publish step: the plugin's "package" is the manifest the marketplace reads from the repo, so only the version half of changesets/action is used.
Security note
The
gh pr mergestep passes the PR number through anenv:variable (PR_NUMBER) rather than interpolating${{ steps.changesets.outputs.pullRequestNumber }}directly into the shell command — eliminating the injection surface even though the value is numeric and action-controlled.Required repo settings (enable before this works)
mainwith ≥1 required status check —gh pr merge --autoneeds a check to gate on; with none, auto-merge has nothing to wait for.Notes
main): it keeps the bump reviewable/visible and avoids racing concurrent merges, while auto-merge keeps it hands-off.src), sorequire-changesetpasses on it.🤖 Generated with Claude Code